<!-- saved from url=(0014)about:internet -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JavaPowUpload events</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style5 {
	font-family: "Courier New", Courier, monospace;
	font-size: 100%;
}
-->
</style></head>

<body>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr>
    <td width="400"><span class="caption">MultiPowUpload </span><span class="yellow">3.1</span> <br />
        <span class="gray">Events</span> </td>
    <td>&nbsp;</td>
    <td align="char" width="200"><img src="world.jpg" align="middle" hspace="5" /><b><a target="_blank" href="http://www.element-it.com/multiple-file-upload/flash-uploader.aspx">Home
      page</a></b><br />
                          <img src="email.jpg" align="middle" hspace="5" /><b><a target="_blank" href="http://www.element-it.com/contacts.aspx">Contact
                            support</a></b> </td>
  </tr>
</table>
<p class="topic"><b>MultiPowUpload events</b>&nbsp;
</p>
<p>For more information on how to use MultiPowUpload events see <a href="HowTo.html#javaScript">How to section. </a></p>
<p>  In the list below there are all available MultiPowUpload events.</p>
<br />

<!--<p>
  <a href="Events.html#onMovieLoad">onMovieLoad   event</a><br />
 <br />
  <a href="Events.html#onAddFiles">onAddFiles   event</a><br />
  <br />
  <a href="Events.html#onRemoveFiles">onRemoveFiles   event</a><br />
  <br />
  <a href="Events.html#onSelectItems">onSelectItems  event</a><br />
  <br />
  <a href="Events.html#onListChange">onListChange   event</a><br />
  <br />
  <a href="Events.html#onClearList">onClearList   event</a><br />
  <br />
  <a href="Events.html#onBeforeStart">onBeforeStart   event</a><br />
  <br />
  <a href="Events.html#onFileStart">onFileStart   event</a><br />
  <br />
  <a href="Events.html#onFileComplete">onFileComplete   event</a><br />
  <br />
  
  <a href="Events.html#onStart">onStart  event</a><br />
  <br />    
  <a href="Events.html#onProgress">onProgress   event</a><br />
  <br />
  <a href="Events.html#onCancel">onCancel   event</a><br />
  <br />
  <a href="Events.html#onComplete">onComplete  event</a><br />
  <br />
  <a href="Events.html#onServerResponse">onServerResponse  event</a><br />
  <br />  
  <a href="Events.html#onError">onError   event</a><br />
  <br />

  
  <a href="Events.html#onImageLoaded">onImageLoaded   event</a><br />
  <br />  
  <a href="Events.html#onThumbnailGenerateStart">onThumbnailGenerateStart   event</a><br />
  <br />
  <a href="Events.html#onThumbnailGenerateProgress">onThumbnailGenerateProgress   event</a><br />
  <br />
  <a href="Events.html#onThumbnailGenerateComplete">onThumbnailGenerateComplete   event</a><br />
  <br />
  
  <a href="Events.html#onThumbnailUploadStart">onThumbnailUploadStart   event</a><br />
  <br />
  <a href="Events.html#onThumbnailUploadComplete">onThumbnailUploadComplete   event</a><br/>
  <br/>
  
  <a href="Events.html#onErrorMessage">onErrorMessage   event</a><br />
  <br />
  <a href="Events.html#onDebug">onDebug   event</a><br />
  <br />

  <a href="Events.html#onLoadVars">onLoadVars   event</a><br />
  <br />
  <a href="Events.html#onLoadVarsError">onLoadVarsError   event</a><br />
  <br />
  
</p>
-->

<p class="topicLeft" name="onMovieLoad" id="onMovieLoad">onMovieLoad (onMovieLoad event listener)</p>
<div class="signature"><p>function onMovieLoad() {}</p></div>
<p>It is invoked when MultiPowUpload is loaded and ready to work.</p>
 <p>Using this event you can check if it is possible to use Flash functions from
JavaScript code and when Flash is ready for it.</p>
<h4>Example</h4>
<code>

function MultiPowUpload_onMovieLoad()<br />
{<br />
	window.alert(&quot;MultiPowUpload is loaded and your browser supports ExternalInterface!&quot;);<br />
}<br />

</code>

<p class="topicLeft" name="onAddFiles" id="onAddFiles">onAddFiles</p>
<div class="signature">
  <p>function onAddFiles(ListItem[] files, ListItem[] ignoredFiles) {}</p>
</div>
<p>It is invoked  when a user selects files for upload from the file-browsing dialog box.  </p>
<h4>Parameters</h4>
<p><strong>files</strong><code>:ListItem[]</code> - Array of ListItem objects that represent added files.<br />
  <strong>ignoredFiles</strong><code>:ListItem[]</code> - Array of ListItem objects that represent ignored for some reason files. ListItem objects in this array are not added to the file list. But you may analyze ignored files or print out information about them to the user. </p>
<h4>Example</h4>
<code>

function MultiPowUpload_onAddFiles(addedFiles, ignoredFiles)<br />
{<br />
	window.alert(&quot;You have selected &quot;+addedFiles.length+&quot; for upload! And &quot;+ignoredFiles.length+&quot; files were ignored&quot;);<br />
}<br />
</code>


<p class="topicLeft" name="onRemoveFiles" id="onRemoveFiles">onRemoveFiles</p>
<div class="signature"><p>function onRemoveFiles(ListItem[] files) {}</p></div>
<p>It is invoked when a user removes one or several files from a list. </p>
<h4>Parameters</h4>
<p><strong>files</strong><code>:ListItem[]</code> - Array of ListItem objects that represent removed files.</p>
<h4>Example</h4>
<code>

function MultiPowUpload_onRemoveFiles(removedFiles)<br />
{<br />
	window.alert(&quot;You have removed &quot;+removedFiles.length+&quot; from list!&quot;);<br />
}<br />

</code>
	
	
<p class="topicLeft" name="onSelectItems" id="onSelectItems">onSelectItems</p>
<div class="signature"><p>function onSelectItems(ListItem[] files) {}</p></div>
<p>It is invoked when a user selects some files in the current File view (List or Thumbnails view). The event is invoked every time when the selection is changed.</p>
<h4>Parameters</h4>
<p><strong>files</strong><code>:ListItem[]</code> - Array of ListItem objects that represent selected files.</p>
<h4>Example</h4>
<code>

function MultiPowUpload_onSelectItems(selectedFiles)<br />
{<br />
	window.alert(&quot;You have selected &quot;+selectedFiles.length+&quot; files in list!&quot;);<br />
}<br />

</code>

<p class="topicLeft" name="onListChange" id="onListChange">onListChange</p>
<div class="signature"><p>function onListChange() {}</p></div>
<p>It is invoked when a list is changed: files added, removed, sorted, reordered.</p>
<h4>Example</h4>
<code>

function MultiPowUpload_onListChange()<br />
{<br />
	window.alert(&quot;Something was changed in list &quot;);<br />
}<br />

</code>

<p class="topicLeft" name="onClearList" id="onClearList">onClearList</p>
<div class="signature"><p>function onClearList() {}</p></div>
<p>It is invoked when a user clicks "Clear" button and all files are removed from a list. <br /> 
  Note: <a href="Events.html#onRemoveFiles">onRemoveFiles   event</a> does not work when &quot;clear list&quot; button is clicked.</p>
<h4>Example</h4>
<code>

function MultiPowUpload_onClearList()<br />
{<br />
	window.alert(&quot;All files removed from list! &quot;);<br />
}<br />

</code>

<p class="topicLeft" name="onFileStart" id="onFileStart">onFileStart</p>
<div class="signature"><p>function onFileStart(ListItem file) {}</p></div>
<p>It is invoked when upload process of file is started. This event is invoked for each file in the upload queue.</p>
<h4>Parameters</h4>
<p><strong>file</strong><code>:ListItem</code> -Instance of ListItem object that represent the file.</p>
<h4>Example</h4>
<code>

function MultiPowUpload_onFileStart(file)<br />
{<br />
	window.alert(&quot;Uploading file: &quot;+file.name);<br />
}<br />

</code>

<p class="topicLeft" name="onFileComplete" id="onFileComplete">onFileComplete</p>
<div class="signature"><p>function onFileComplete(ListItem file) {}</p></div>
<p>It is invoked when upload process of file is completed. This event is invoked for each file in the upload queue.</p>
<h4>Parameters</h4>
<p><strong>file</strong><code>:ListItem</code> -Instance of ListItem object that represent the file.</p>
<h4>Example</h4>
<code>

function MultiPowUpload_onFileComplete(file)<br />
{<br />
	window.alert(&quot;File upload complete: &quot;+file.name);<br />
}<br />

</code>

<p class="topicLeft" name="onStart" id="onStart">onStart</p>
<div class="signature"><p>function onStart() {}</p></div>
<p>It is invoked  before the upload process is started. </p>
<h4>Example</h4>
<code>

function MultiPowUpload_onStart()<br />
{<br />
	window.alert(&quot;Upload process started! &quot;);<br />
}<br />

</code>

<p class="topicLeft" name="onProgress" id="onProgress">onProgress</p>
<div class="signature"><p>function onProgress(ListItem file) {}</p></div>
<p>It is invoked periodically during the file upload operation. The <code>onProgress</code> event is invoked while MultiPowUpload transmits bytes to a server, and it is periodically invoked during the transmission.</p>
<p>In some cases, <code>MultiPowUpload_onProgress</code> event is not invoked; for example, if the transmitted file is very small, or if the upload goes very quickly.</p>
<h4>Parameters</h4>
<p><strong>file</strong><code>:ListItem</code> -Instance of ListItem - currently uploaded file.</p>
<h4>Example</h4>
<code>

function MultiPowUpload_onProgress(file)<br />
{<br />
	window.alert(&quot;Uploading file&quot;+file.name+&quot;Total percent: &quot;+MultiPowUpload.getProgressInfo().totalPercent);<br />
}<br />

</code>

<p class="topicLeft" name="onCancel" id="onCancel">onCancel</p>
<div class="signature"><p>function onCancel() {}</p></div>
<p>It is invoked  when the upload operation is cancelled. </p>
<h4>Example</h4>
<code>

function MultiPowUpload_onCancel()<br />
{<br />
	window.alert(&quot;Upload process cancelled! &quot;);<br />
}<br />

</code>

<p class="topicLeft" name="onComplete" id="onComplete">onComplete</p>
<div class="signature"><p>function onComplete() {}</p></div>
<p>It is invoked  when the upload operation has been completed sucessfully. </p>
<h4>Example</h4>
<code>

function MultiPowUpload_onComplete()<br />
{<br />
	window.alert(&quot;Upload complete! &quot;);<br />
}<br />

</code>


<p class="topicLeft" name="onServerResponse" id="onServerResponse">onServerResponse</p>
<div class="signature"><p>function onServerResponse(ListItem file) {}</p></div>
<p>It is invoked  when MultiPowUpload receives a response from server.</p>
<p>In some cases, <code>MultiPowUpload_onResponse</code> event is not invoked; for example, when the server sends an empty response .</p>
<h4>Parameters</h4>
<p><strong>file</strong><code>:ListItem</code> -Instance of ListItem object. </p>
<h4>Example</h4>
<code>

function MultiPowUpload_onServerResponse(file)<br />
{<br />
	window.alert(&quot;Response for file: &quot;+file.name+&quot; is : &quot;+file.serverResponse);<br />
}<br />

</code>


<p class="topicLeft" name="onError" id="onError">onError</p>
<div class="signature"><p>function onError(ListItem file, String message) {}</p></div>
<p>It is invoked  when MultiPowUpload receives a response from server.</p>
<p>In some cases, <code>MultiPowUpload_onResponse</code> event is not invoked; for example, when the server send an empty response .</p>
<h4>Parameters</h4>
<p><strong>file</strong><code>:ListItem</code> - Instance of ListItem object. </p>
<p><strong>message</strong><code>:String</code> - Error message text. </p>
<h4>Example</h4>
<code>

function MultiPowUpload_onError(file, message)<br />
{<br />
	window.alert(&quot;Error uploading file &quot;+file.name+&quot;  : &quot;+message);<br />
}<br />

</code>


<p class="topicLeft" name="onImageLoaded" id="onImageLoaded">onImageLoaded</p>
<div class="signature"><p>function onImageLoaded(ListItem file) {}</p></div>
<p>It is invoked when MultiPowUpload loads an image file. The image file is loaded by MultiPowUpload when thumbnails are generated for preview in Thumbnails view mode  (or File info window) or when thumbnails are generated for upload.</p>

<h4>Parameters</h4>
<p><strong>file</strong><code>:ListItem</code> - Instance of ListItem object. </p>
<h4>Example</h4>
<code>

function MultiPowUpload_onImageLoaded(file)<br />
{<br />
	window.alert(&quot;Count of exif tags loaded: &quot;+file.exif.length);<br />
}<br />

</code>


<p class="topicLeft" name="onThumbnailGenerateStart" id="onThumbnailGenerateStart">onThumbnailGenerateStart</p>
<div class="signature"><p>function onThumbnailGenerateStart() {}</p></div>
<p>It is invoked  when thumbnails generation process is started.</p>
<h4>Example</h4>
<p>
 <code>
function MultiPowUpload_onThumbnailGenerateStart()<br />

{<br />

	window.alert(&quot;Thumbnails being prepared for upload.&quot;);<br />

}
</code>
</p>

<p class="topicLeft" name="onThumbnailGenerateProgress" id="onThumbnailGenerateProgress">onThumbnailGenerateProgress</p>
<div class="signature"><p>function onThumbnailGenerateProgress(countCompleted:Integer, totalFiles:Integer, percent:Float) {}</p></div>
<p>It is invoked  for each image file when thumbnail generation of a single file is completed.</p>
<h4>Parameters</h4>
<p><strong>countCompleted</strong><code>:String</code> - count of images that have already been processed.</p>
<p><strong>totalFiles</strong><code>:Integer</code> - Total images count to be processed.</p>
<p><strong>percent</strong><code>:Float</code> - Percent of completion.</p>
<h4>Example</h4>
<p>
 <code>
function MultiPowUpload_onThumbnailGenerateProgress(countCompleted, totalFiles, percent)<br />

{<br />

	window.alert(countCompleted + &quot; of  &quot; + totalFiles+ &quot; images processed.&quot;);<br />

}
</code>
</p>


<p class="topicLeft" name="onThumbnailGenerateComplete" id="onThumbnailGenerateComplete">onThumbnailGenerateComplete</p>
<div class="signature"><p>function onThumbnailGenerateComplete() {}</p></div>
<p>It is invoked  when the thumbnails generation process is completed.</p>
<h4>Example</h4>
<p>
 <code>
function MultiPowUpload_onThumbnailGenerateComplete()<br />

{<br />

	window.alert(&quot;Thumbnails ready for upload.&quot;);<br />

}
</code>
</p>

<p class="topicLeft"  name="onThumbnailUploadStart" id="onThumbnailUploadStart">onThumbnailUploadStart</p>
<div class="signature">
  <p>function onThumbnailUploadStart(ListItem file) {}</p>
</div>
<p>It is invoked when the file thumbnail upload process  is started.</p>
<h4>Parameters</h4>
<p><strong>file</strong><code>:ListItem</code> - Instance of ListItem object. </p>
<h4>Example</h4>
<p>
 <code>
function MultiPowUpload_onThumbnailUploadStart(file)<br />
{<br />

	window.alert(&quot;Starting upload thumbnail of &quot;+file.name);<br />

}
</code>
</p>

<p class="topicLeft" name="onThumbnailUploadComplete" id="onThumbnailUploadComplete">onThumbnailUploadComplete</p>
<div class="signature">
  <p>function onThumbnailUploadComplete(ListItem file, String response) {}</p>
</div>
<p>It is invoked when the current file thumbnail upload process   has been completed. </p>
<h4>Parameters</h4>
<p><strong>file</strong><code>:ListItem</code> - Instance of ListItem object. </p>
<p><strong>response</strong><code>:String</code> - Server response for current thumbnail upload. </p>
<h4>Example</h4>
<p>
 <code>
function MultiPowUpload_onThumbnailUploadComplete(file, response)<br />

{<br />

	window.alert(&quot;Thumbnail upload of &quot;+file.name+&quot; completed.&quot;);<br />

}
</code>
</p>


<p class="topicLeft" name="onErrorMessage" id="onErrorMessage">onErrorMessage</p>
<div class="signature">
  <p>function onErrorMessage(String message, Boolean displayed) {}</p>
</div>
<p>It is invoked every time when MultiPowUpload displays some error message.  For example, when a user selects files with non-allowed file type. 
This event is helpfull if you use MultiPowUpload in the hidden mode, or if the size of MultiPowUpload is too small and error windows are not displayed.</p>
<h4>Parameters</h4>
<p><strong>message</strong><code>:String</code> - Error message text. </p>
<p><strong>displayed</strong><code>:Boolean</code> - true if this message was displayed in Flash UI by MultiPowUpload, otherwise false. The messages may not be  displayed whe n MultiPowUpload is in the hidden mode or the file size is too small (less then 75x75 pxels) or the value of <a href="Parameters_ui.html#showAlert">showAlert</a> parameter is set to false. </p>
<h4>Example</h4>
<p>
 <code>
function MultiPowUpload_onErrorMessage(message, displayed)<br />

{<br />

	if(!displayed)<br />
		window.alert(message);<br />

}
</code>
</p>



<p class="topicLeft" name="onDebug" id="onDebug">onDebug</p>
<div class="signature"><p>function onDebug(String message) {}</p></div>
<p>It is invoked  every time when MultiPowUpload shows some debug messages. This event works only if the value of <a href="Parameters_function.html#debug.enabled" target="main" onclick="clickAnchor(this)">debug.enabled</a> is set to true.
<h4>Parameters</h4>
<p><strong>message</strong><code>:String</code> - Debug message text. </p>
<h4>Example</h4>
<p>
 <code>
function MultiPowUpload_onDebug(message)<br />

{<br />

	window.alert(message);<br />

}
</code>
</p>


<p name="onLoadVarsError" id="onLoadVarsError">onLoadVarsError</p>
<div class="signature"><p>function onLoadVarsError() {}</p></div>
<p>It is invoked  if <code>sendAndLoadVars</code> method call is unsucessful.</p>


<h4>Example</h4>

<code>


function MultiPowUpload_onLoadVarsError()<br />

{<br />

   window.alert("error during sendAndLoadVars method execution ");<br />

}<br />

</code>
</p>


</body>
</html>